(function($){
	
    $.fn.extend({
    	atf_display_loader: function(message){
    		var cls='alert-info';
        	var html='';
            html+='<p><img src="images/ajax-loader.gif" height="24px", width="24px"/>'+message+'</p>';
            $(this).html(html);
    	},
        atf_alert: function(message, title){
        	$(this).removeClass()
            var cls='alert-danger';
            var html='<div class="alert '+cls+' alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
            if(typeof title!=='undefined' &&  title!==''){
                html+='<h4>'+title+'</h4>';
            }
            html+='<span>'+message+'</span></div>';
            $(this).html(html);
            var id= $(this).attr("id");
            setTimeout(function() {
            	 $("#"+id).empty();
             }, 5000);
        },
        
        atf_warning: function(message, title){
        	$(this).removeClass()
            var cls='alert-warning';
            var html='<div class="alert '+cls+' alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
            if(typeof title!=='undefined' &&  title!==''){
                html+='<h4>'+title+'</h4>';
            }
            html+='<span>'+message+'</span></div>';
            $(this).html(html);
            var id= $(this).attr("id");
            setTimeout(function() {
            	 $("#"+id).empty();
             }, 5000);
        },
        atf_info: function(message, title){
        	$(this).removeClass()
            var cls='alert-info';
            var html='<div class="alert '+cls+' alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
            if(typeof title!=='undefined' &&  title!==''){
                html+='<h4>'+title+'</h4>';
            }
            html+='<span>'+message+'</span></div>';
            $(this).html(html);
            var id= $(this).attr("id");
            setTimeout(function() {
            	 $("#"+id).empty();
             }, 5000);
        },
        atf_success: function(message, title){
        	$(this).removeClass()
        	 var cls='alert-success';
             var html='<div class="alert '+cls+' alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
             if(typeof title!=='undefined' &&  title!==''){
                 html+='<h4>'+title+'</h4>';
             }
             html+='<span>'+message+'</span></div>';
             $(this).html(html);
             var id= $(this).attr("id");
             setTimeout(function() {
            	 $("#"+id).empty();
              }, 5000);
        },
        
        atf_success_flyover:function(message, title){
        	var cls='alert-success';
        	$(this).removeClass()
        	var html='';
            if(typeof title!=='undefined' &&  title!==''){
                html+= '<h4>'+title+'</h4>';
            }
            html+='<p>'+message+'</p>';
            $(this).html(html);
            $(this).addClass('alert '+cls+' flyover flyover-bottom')
            if ( !$(this).is( '.in' ) ) {
            	 $(this).addClass('in');
            	 var id= $(this).attr("id");
            	 setTimeout(function() {
                     $(this).removeClass('in');
                     $("#"+id).removeClass('in');
                     $(this).empty();
                  }, 5000);
            }
           
        },
        atf_alert_flyover:function(message, title){
        	var cls='alert-danger';
        	$(this).removeClass()
        	var html='';
            if(typeof title!=='undefined' &&  title!==''){
                html+= '<h4>'+title+'</h4>';
            }
            html+='<p>'+message+'</p>';
            $(this).html(html);
            $(this).addClass('alert '+cls+' flyover flyover-bottom')
            if ( !$(this).is( '.in' ) ) {
            	 $(this).addClass('in');
            	 var id= $(this).attr("id");
            	 setTimeout(function() {
                     $(this).removeClass('in');
                     $("#"+id).removeClass('in');
                     $(this).empty();
                  }, 5000);
            }
           
        },
        atf_warn_flyover:function(message, title){
        	var cls='alert-warning';
        //	var html='<div class="alert '+cls+' flyover flyover-bottom">';
        	$(this).removeClass()
        	var html='';
            if(typeof title!=='undefined' &&  title!==''){
                html+= '<h4>'+title+'</h4>';
            }
            html+='<p>'+message+'</p>';
            $(this).html(html);
            $(this).addClass('alert '+cls+' flyover flyover-bottom')
            
            if ( !$(this).is( '.in' ) ) {
            	 $(this).addClass('in');
            	 var id= $(this).attr("id");
            	 setTimeout(function() {
                     $("#"+id).removeClass('in');
                     $(this).empty();
                  }, 5000);
            }
           
        },
        atf_info_flyover:function(message, title){
        	var cls='alert-info';
        	$(this).removeClass()
        	var html='';
            if(typeof title!=='undefined' &&  title!==''){
                html+= '<h4>'+title+'</h4>';
            }
            html+='<p>'+message+'</p>';
            $(this).html(html);
            $(this).addClass('alert '+cls+' flyover flyover-bottom')
            if ( !$(this).is( '.in' ) ) {
            	 $(this).addClass('in');
            	 var id= $(this).attr("id");
            	 setTimeout(function() {
            		 $("#"+id).removeClass('in');
            		 $(this).empty();
                  }, 5000);
            }
           
        }
        
    });
})(jQuery);